#include "VistaMonticulo.h"

VistaMonticulo::VistaMonticulo(Objeto* obj) : Vista(obj) {
	std::string imgPath = "common/imagenes/monticulo.png";
	this->imagen = Gdk::Pixbuf::create_from_file(imgPath);	
	this->x = obj->getX();
	this->y = obj->getY();
}

VistaMonticulo::~VistaMonticulo() {
}

void VistaMonticulo::draw(const Cairo::RefPtr<Cairo::Context>& cr, Gtk::Allocation& allocation){
	const int height = allocation.get_height();
	cr->save();	
	//cr->set_source_rgb(0.0, 0.0, 1.0);
	//cr->set_line_width(10.0);
	Gdk::Cairo::set_source_pixbuf(cr, this->imagen, obj->getX(), height - obj->getY());
	cr->rectangle(obj->getX(), height - obj->getY(), obj->getFigura()->getAncho(), obj->getFigura()->getAlto());
	cr->fill();	
	cr->clip();
	cr->paint();
	cr->restore();
	cr->stroke();
	
}
